Scripting > CxHmiGrp > CxGrpTree Object > CxGrpTree Events

CxGrpTree Events

The CxGrpTree object contains the following events:

OnContextMenu

Fired when the user selects a custom context menu item.

Syntax

CxGrpTreeCtrl_EventContextMenu(EventId As String)

Parameters

Parameter Required Description

EventId

Yes

Identifier of the menu item selected by the user.

Example

The following example handles each context menu item. This example is taken from CxGrpTree Example.

Sub CxGrpTree_EventContextMenu(EventID)

Dim This : Set This = CxGrpTree

 

If EventID = "EVENT_EXPAND" Then

CxGrpTree.Expand False

Elseif EventID = "EVENT_COLLAPSE" Then

CxGrpTree.Collapse False

Elseif EventID = "EVENT_REFRESH" Then

CxGrpTree.Refresh

End If

 

End Sub

Back to top

OnSelChange

Fired when the user changes the selected node.

Syntax

CxGrpTreeCtrl_EventOnSelChange()

Example

The following example displays attributes of the selected node. This example is taken from CxGrpTree Example.

Sub CxGrpTree_EventOnSelChange()

Dim This : Set This = CxGrpTree

 

Dim strMsg

strMsg = "Details for node " + CxGrpTree.GetSelectedNodeAttrValue("~nodeid")

strMsg = strMsg + vbCrlf + vbCrlf

 

strMsg = strMsg + "Description: " + CxGrpTree.GetSelectedNodeAttrValue("~desc")

strMsg = strMsg + vbCrlf

 

strMsg = strMsg + "Category: " + CxGrpTree.GetSelectedNodeAttrValue("~cat")

strMsg = strMsg + vbCrlf

 

strMsg = strMsg + "Type: " + CxGrpTree.GetSelectedNodeAttrValue("~type")

strMsg = strMsg + vbCrlf

 

strMsg = strMsg + "# of Children: " + _CStr(CxGrpTree.GetSelectedNodeChildCount())

 

eboDetails.Text = strMsg

 

End Sub

Back to top

Let us know how we can improve this topic.

CygNet at weatherford.com

© 2020 Weatherford. All rights reserved.